home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 1320 / 1320.xpi / defaults / transforms / prefs-0.5.7.xsl < prev    next >
Extensible Markup Language  |  2010-01-22  |  5KB  |  127 lines

  1. <?xml version="1.0"?>
  2.  
  3. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4.     version="1.0">
  5.     
  6.     <xsl:template match="/">
  7.         <xsl:apply-templates/>
  8.     </xsl:template>
  9.     
  10.     <xsl:template match="prefs">
  11.         <prefs version="0.6">
  12.             <xsl:apply-templates/>
  13.         </prefs>
  14.     </xsl:template>
  15.     
  16.     <xsl:template match="account[@type='global']">
  17.         <account type="global">
  18.             <pref id="general-hide-context-menu" value="false"/>
  19.             <pref id="general-hide-tools-menu" value="false"/>
  20.             <pref id="general-auto-login" value="false"/>
  21.             <pref id="security-secured-connection" value="true"/>
  22.             <pref id="toolbar-auto-login" value="false"/>
  23.             <pref id="toolbar-auto-check" value="false"/>
  24.             
  25.             <xsl:apply-templates select="pref"/>
  26.         </account>
  27.     </xsl:template>
  28.     
  29.     <xsl:template match="account[@type and @email and @alias]">
  30.         <account>
  31.             <xsl:copy-of select="@*"/>
  32.             
  33.             <pref id="toolbar-display" value="false"/>
  34.             <pref id="toolbar-toolbar-id" value="status-bar"/>
  35.             <pref id="toolbar-placement" value="always-last"/>
  36.             <pref id="toolbar-specific-position" value="0"/>
  37.             <pref id="notifications-check" value="true"/>
  38.             
  39.             <xsl:apply-templates select="pref"/>
  40.         </account>
  41.     </xsl:template>
  42.     
  43.     <xsl:template match="pref">
  44.         <xsl:choose>
  45.             <xsl:when test="@id = 'compose-context-menu-mailto'"/>
  46.             <xsl:when test="@id = 'compose-context-menu-position'"/>
  47.             <xsl:when test="@id = 'toolbar-statusbar-display'"/>
  48.             <xsl:when test="@id = 'toolbar-statusbar-always-last'"/>
  49.             <xsl:when test="@id = 'toolbar-statusbar-position'"/>
  50.             <xsl:when test="@id = 'notifications-clickable-alerts'"/>
  51.             <xsl:when test="@id = 'general-secured-connection'"/>
  52.             <xsl:when test="@id = 'notifications-alerts-message-count'"/>
  53.             <xsl:otherwise>
  54.                 <xsl:call-template name="pref2"/>
  55.             </xsl:otherwise>
  56.         </xsl:choose>
  57.     </xsl:template>
  58.     
  59.     <xsl:template name="pref2">
  60.         <pref>
  61.             <xsl:choose>
  62.                 <xsl:when test="@id = 'general-never-save-passwords'">
  63.                     <xsl:attribute name="id">security-never-save-passwords</xsl:attribute>
  64.                     <xsl:copy-of select="@value"/>
  65.                 </xsl:when>
  66.                 
  67.                 <xsl:when test="@id = 'compose-tab-location'">
  68.                     <xsl:copy-of select="@id"/>
  69.                     <xsl:choose>
  70.                         <xsl:when test="@value = 0"><xsl:attribute name="value">blank</xsl:attribute></xsl:when>
  71.                         <xsl:when test="@value = 1"><xsl:attribute name="value">current</xsl:attribute></xsl:when>
  72.                         <xsl:when test="@value = 2"><xsl:attribute name="value">focused</xsl:attribute></xsl:when>
  73.                         <xsl:when test="@value = 3"><xsl:attribute name="value">background</xsl:attribute></xsl:when>
  74.                         <xsl:when test="@value = 4"><xsl:attribute name="value">window</xsl:attribute></xsl:when>
  75.                         <xsl:otherwise>
  76.                             <xsl:attribute name="value"></xsl:attribute>
  77.                         </xsl:otherwise>
  78.                     </xsl:choose>
  79.                 </xsl:when>
  80.                 
  81.                 <xsl:when test="@id = 'compose-mailto-default'">
  82.                     <xsl:copy-of select="@id"/>
  83.                     <xsl:variable name="value" select="@value + 1"/>
  84.                     <xsl:attribute name="value">
  85.                         <xsl:value-of select="//account[@type and @email and @alias][position() = $value]/@email"/>
  86.                     </xsl:attribute>
  87.                 </xsl:when>
  88.                 
  89.                 <xsl:when test="@id = 'toolbar-left-click' or @id = 'toolbar-middle-click'">
  90.                     <xsl:copy-of select="@id"/>
  91.                     <xsl:choose>
  92.                         <xsl:when test="@value = 2"><xsl:attribute name="value">check-messages</xsl:attribute></xsl:when>
  93.                         <xsl:when test="@value = 3"><xsl:attribute name="value">compose-message</xsl:attribute></xsl:when>
  94.                         <xsl:when test="@value = 5"><xsl:attribute name="value">blank</xsl:attribute></xsl:when>
  95.                         <xsl:when test="@value = 6"><xsl:attribute name="value">current</xsl:attribute></xsl:when>
  96.                         <xsl:when test="@value = 7"><xsl:attribute name="value">focused</xsl:attribute></xsl:when>
  97.                         <xsl:when test="@value = 8"><xsl:attribute name="value">background</xsl:attribute></xsl:when>
  98.                         <xsl:when test="@value = 9"><xsl:attribute name="value">window</xsl:attribute></xsl:when>
  99.                         <xsl:otherwise>
  100.                             <xsl:attribute name="value"></xsl:attribute>
  101.                         </xsl:otherwise>
  102.                     </xsl:choose>
  103.                 </xsl:when>
  104.                 
  105.                 <xsl:when test="@id = 'notifications-switch-account'">
  106.                     <xsl:attribute name="id">toolbar-auto-switch</xsl:attribute>
  107.                     <xsl:copy-of select="@value"/>
  108.                 </xsl:when>
  109.                 
  110.                 <xsl:when test="@id = 'general-automatic-login'">
  111.                     <xsl:attribute name="id">general-auto-login</xsl:attribute>
  112.                     <xsl:copy-of select="@value"/>
  113.                 </xsl:when>
  114.                 
  115.                 <xsl:when test="@id = 'notifications-alerts-snippets'">
  116.                     <xsl:attribute name="id">notifications-display-snippets</xsl:attribute>
  117.                     <xsl:copy-of select="@value"/>
  118.                 </xsl:when>
  119.                 
  120.                 <xsl:otherwise>
  121.                     <xsl:copy-of select="@id"/>
  122.                     <xsl:copy-of select="@value"/>
  123.                 </xsl:otherwise>
  124.             </xsl:choose>
  125.         </pref>
  126.     </xsl:template>
  127. </xsl:stylesheet>